﻿CREATE PROCEDURE [TipVieweds_insert]
	@P_1 Int,
	@P_2 Int,
	@P_3 Int,
	@P_4 DateTime,
	@sync_row_count Int OUTPUT
AS
BEGIN
SET @sync_row_count = 0; IF NOT EXISTS (SELECT * FROM [TipVieweds_tracking] WHERE [TipViewedID] = @P_1) BEGIN SET IDENTITY_INSERT [TipVieweds] ON; INSERT INTO [TipVieweds]([TipViewedID], [UserID], [TipID], [DateTimeStamp]) VALUES (@P_1, @P_2, @P_3, @P_4);  SET @sync_row_count = @@rowcount; SET IDENTITY_INSERT [TipVieweds] OFF; END 
END